<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <button onclick="onButtonClick();">存数据</button>
    <br>
    <a href="localStorageGet.html">下一个页面</a>
    <script>
        function onButtonClick(){
            localStorage.setItem("username","张三");
        }
    </script>
</body>
</html>